import Vue from 'vue'
import Router from 'vue-router'

import Login from '@/components/Login/Login'
import Home from '@/components/Home/Home'
const HomePage = ()=> import('@/components/Home/HomePage')
// 当前用户信息
import  UserInfo from '@/components/Home/UserInfo'
//系统管理
const SystemManage = ()=> import('@/components/System/SystemManage');
const PermissionManage = ()=>import('@/components/System/PermissionManage/PermissionManage')
const AddPermissionView = ()=> import('@/components/System/PermissionManage/AddPermissionView');
const UpdatePermissionView = ()=> import('@/components/System/PermissionManage/UpdatePermissionView');
const RoleManage = ()=> import('@/components/System/RoleManage/RoleManage');
const AddNewRoleView = ()=> import('@/components/System/RoleManage/AddNewRoleView');
const AccountManage = ()=> import('@/components/System/AccountManage/AccountManage');
const AccountDetail = ()=> import('@/components/System/AccountManage/AccountDetail');
const AccountEditView = ()=> import('@/components/System/AccountManage/AccountEditView');
const AddAccountView = ()=> import('@/components/System/AccountManage/AddAccountView');

//社招管理
const SocialManage = ()=> import('@/components/Social/SocialManage')
const SocialVisitor = ()=> import('@/components/Social/SocialVisitor')
const EnrollManage = ()=> import('@/components/Social/EnrollManage')
const EnrollFllowVisitor = ()=> import('@/components/Social/EnrollFllowVisitor')
const TryManage = ()=> import('@/components/Social/TryManage')
const AddNewVistor = ()=> import('@/components/Social/AddNewVistor')
const FollowVisitor = ()=> import('@/components/Social/FollowVisitor')
const InvalidVisitor = ()=> import('@/components/Social/InvalidVisitor')
const FollowInvalidVisitor = ()=> import('@/components/Social/FollowInvalidVisitor')
const TotryFllowVisitor = ()=> import('@/components/Social/TotryFllowVisitor')

//配置管理
const ConfigureManage = ()=> import('@/components/Configure/ConfigureManage')
const SettingsVuew = ()=> import('@/components/Configure/SettingsVuew')
const AddNewSetting = ()=> import('@/components/Configure/AddNewSetting')

// 渠道管理
const ChannelManage = ()=> import('@/components/Channel/ChannelManage')
const ChannelStudentManage = ()=> import('@/components/Channel/ChannelStudentManage')
const ContactListManage = ()=> import('@/components/Channel/ContactListManage')
const SchoolManage = ()=> import('@/components/Channel/SchoolManage')

//后期管理
const LaterStageManage = ()=> import('@/components/Class/LaterStageManage')
const ClassManage = ()=> import('@/components/Class/ClassManage')
const ClassStudentManage = ()=> import('@/components/Class/ClassStudentManage')
const StepIntoClassManage = ()=> import('@/components/Class/StepIntoClassManage')
const AddNewClass = ()=> import('@/components/Class/AddNewClass')
const AddNewStudent = ()=> import('@/components/Class/AddNewStudent')
const FollowStudentInfo = ()=> import('@/components/Class/FollowStudentInfo')
const EditClass = ()=> import('@/components/Class/EditClass')
//校区管理
const SectionManage = ()=> import('@/components/Section/SectionManage')
const CityManage = ()=> import('@/components/Section/City/CityManage')
const CampusManage = ()=> import('@/components/Section/Campus/CampusManage')
const addNewCityView = ()=> import('@/components/Section/City/addNewCityView')


//口碑管理
const ReputationManage = ()=> import('@/components/Reputation/ReputationManage')
const ReputationStudentManage = ()=> import('@/components/Reputation/ReputationStudentManage')
const AddNewReputationStudent = ()=> import('@/components/Reputation/AddNewReputationStudent')
// const  = ()=> import('')
//异常管理
const StudentException = ()=>import('@/components/Exception/StudentException')
//当前登录用户相关
const MyStudentList = ()=> import ('@/components/Profile/MyStudentList')
Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
      {
        path: '/',
        redirect: '/home'
      },
      {
        path:'/login',
        component: Login,
        name: 'login'
      },
      {
        path: '/home',
        component: Home,
        name: 'home',
        redirect: {name: '首页'},
        children: [
          {
            path: 'HomePage',
            component: HomePage,
            name: '首页',
            meta: {
              routeLevel: 1
            }
          },
          {
            path: 'UserInfo',
            component: UserInfo,
            name: 'UserInfo',
            meta: {
              routeLevel: 1
            }
          },
          {
            path: 'MyStudentList',
            component: MyStudentList,
            name: 'MyStudentList'
          },
          {
            path: 'System',
            component: SystemManage,
            name: '系统管理',
            meta: {
              routeLevel: 1
            },
            redirect: {name: "权限管理"},
            children: [
              {
                path: 'PermissionManage',
                component: PermissionManage,
                name: '权限管理',
                meta: {
                  routeLevel: 2
                }
              },
              {
                path: 'AddPermissionView',
                component: AddPermissionView,
                name: 'AddPermissionView',
                meta: {
                  routeLevel: 2
                }
              },
              {
                path: 'UpdatePermissionView',
                component: UpdatePermissionView,
                name: 'UpdatePermissionView',
                meta: {
                  routeLevel: 2
                }
              },
              {
                path: 'RoleManage',
                component: RoleManage,
                name: '角色管理',
                meta: {
                  routeLevel: 2
                },
                children: [
                  {
                    path: 'AddNewRoleView',
                    component: AddNewRoleView,
                    name: 'AddNewRoleView',
                    meta: {
                      routeLevel: 3
                    }
                  }
                ]
              },
              {
                path: 'AccountManage',
                component: AccountManage,
                name: '账户管理',
                children: [
                  {
                    path: 'AccountDetail',
                    component: AccountDetail,
                    name: 'AccountDetail'
                  },
                  {
                    path: 'AccountEditView',
                    component: AccountEditView,
                    name: 'AccountEditView'
                  },
                  {
                    path: 'AddAccountView',
                    component: AddAccountView,
                    name: 'AddAccountView'
                  }
                ]
              }
            ]
          },
          {
            path: 'SocialManage',
            component: SocialManage,
            name: '社招管理',
            redirect: {name: "上门量管理"},
            meta: {
              routeLevel: 1
            },
            children: [
              {
                path: 'SocialVisitor',
                component: SocialVisitor,
                name: '上门量管理',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'EnrollManage',
                component: EnrollManage,
                name: '报名量管理',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'EnrollFllowVisitor',
                component: EnrollFllowVisitor,
                name: 'EnrollFllowVisitor',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'TryManage',
                component: TryManage,
                name: '试学量管理',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'AddNewVistor',
                component: AddNewVistor,
                name: 'AddNewVistor',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'FollowVisitor',
                component: FollowVisitor,
                name: 'FollowVisitor',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'InvalidVisitor',
                component: InvalidVisitor,
                name: '无效量分量管理',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'FollowInvalidVisitor',
                component: FollowInvalidVisitor,
                name: 'FollowInvalidVisitor',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'TotryFllowVisitor',
                component: TotryFllowVisitor,
                name: 'TotryFllowVisitor',
                meta: {
                  routeLevel: 2
                },
              }
            ]
          },
          {
            path: 'ConfigureManage',
            component: ConfigureManage,
            name: '配置管理',
            meta: {
              routeLevel: 1
            },
            redirect: {name: '配置'},
            children: [
              {
                path: 'SettingsVuew',
                component: SettingsVuew,
                name: '配置',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'AddNewSetting',
                component: AddNewSetting,
                name: 'AddNewSetting',
                meta: {
                  routeLevel: 2
                },
              }
            ]
          },
          {
            path: 'ChannelManage',
            component: ChannelManage,
            name: '渠道管理',
            redirect: {name: '学员名单管理'},
            meta: {
              routeLevel: 1
            },
            children: [
              {
                path: 'ChannelStudentManage',
                component: ChannelStudentManage,
                name: '学员名单管理',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'ContactListManage',
                component: ContactListManage,
                name: '联系人管理',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'SchoolManage',
                component: SchoolManage,
                name: '渠道校园管理',
                meta: {
                  routeLevel: 2
                },
              }
            ]
          },
          {
            path: 'LaterStageManage',
            component: LaterStageManage,
            name: '后期管理',
            redirect: {name: '班级管理'},
            meta: {
              routeLevel: 1
            },
            children: [
              {
                path: 'ClassManage',
                component: ClassManage,
                name: '班级管理',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'ClassStudentManage',
                component: ClassStudentManage,
                name: '班级学员管理',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'StepIntoClassManage',
                component: StepIntoClassManage,
                name: '入班管理',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'AddNewClass',
                component: AddNewClass,
                name: 'AddNewClass',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'AddNewStudent',
                component: AddNewStudent,
                name: 'AddNewStudent',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path:'FollowStudentInfo',
                component: FollowStudentInfo,
                name: 'FollowStudentInfo',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'EditClass',
                component: EditClass,
                name: 'EditClass',
                meta: {
                  routeLevel: 2
                },
              }
            ]
          },
          {
            path: 'SectionManage',
            component: SectionManage,
            name: '校区管理',
            meta: {
              routeLevel: 1
            },
            redirect: {name:'城市管理'},
            children: [
              {
                path: 'CityManage',
                component: CityManage,
                name: '城市管理',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'CampusManage',
                component: CampusManage,
                name: '学校管理',
                meta: {
                  routeLevel: 2
                },
              }
            ]
          },
          {
            path: 'ReputationStudentManage',
            component: ReputationStudentManage,
            name: '口碑学员管理',
            meta: {
              routeLevel: 1
            },
            redirect: {name: '口碑管理'},
            children: [
              {
                path: 'ReputationManage',
                component: ReputationManage,
                name: '口碑管理',
                meta: {
                  routeLevel: 2
                },
              },
              {
                path: 'AddNewReputationStudent',
                component: AddNewReputationStudent,
                name: 'AddNewReputationStudent',
                meta: {
                  routeLevel: 2
                },
              }
            ]
          },
          {
            path: 'StudentException',
            component: StudentException,
            name: '异常管理',
            
          }
        ]
      }
  ]
})
